<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>My Orders</title>
</head>
<body>
<!-- 包含顶部模板 -->
<div th:replace="~{common/top :: fragment}"></div>

<div id="BackLink">
  <a th:href="@{/mainForm}">Return to Main Menu</a>
</div>

<div id="Catalog">
  <h2>My Orders</h2>

  <table>
    <tr>
      <th>Order ID</th>
      <th>Date</th>
      <th>Total Price</th>
    </tr>

    <tr th:each="order : ${orderList}">
      <td>
        <a th:href="@{/viewOrder(orderId=${order.orderId})}"
           th:text="${order.orderId}"></a>
      </td>
      <td th:text="${#dates.format(order.orderDate, 'yyyy/MM/dd HH:mm:ss')}"></td>
      <td th:text="${#numbers.formatCurrency(order.totalPrice)}"></td>
    </tr>
  </table>

  <div id="Separator"> </div>
</div>

<!-- 包含底部模板 -->
<div th:replace="~{common/bottom :: fragment}"></div>
</body>
</html>